﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Xml.Serialization;

namespace RTMBindings.Responses
{
    [XmlRoot("rsp")]
    public class RTMGetTokenResponse : RTMSuccessReponse
    {
        [XmlElement("auth")]
        public RTMAuth Auth { get; set; }
    }

    public class RTMAuth
    {
        [XmlElement("token")]
        public string Token { get; set; }

        [XmlElement("perms")]
        public RTMPermissions Permissions { get; set; }

        [XmlElement("user")]
        public RTMUser User { get; set; }

    }

    public class RTMUser
    {
        [XmlAttribute("id")]
        public int Id { get; set; }
        [XmlAttribute("username")]
        public string Username { get; set; }
        [XmlAttribute("fullname")]
        public string FullName { get; set; }
    }

    public enum RTMPermissions
    {
        [XmlEnum("read")]
        Read,
        [XmlEnum("write")]
        Write,
        [XmlEnum("delete")]
        Delete
    }
}
